package com.base.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.base.mapper.CntrMovReqMapper;
import com.base.model.CntrMovReq;
import com.base.service.ISimpleService;
import com.base.vo.LoginUserInfo;

/**
 * @类描述：业务示例实现
 * @创建人：wangdw
 * @创建时间：2019年2月25日 下午4:17:13
 */
@Service
public class SimpleServiceImpl implements ISimpleService {
    @Autowired
    private CntrMovReqMapper mapper;
    
    @Override
    public List<CntrMovReq> queryAll() {
        return mapper.selectAll();
    }
    
    @Override
    @Cacheable(cacheNames = "user", key = "'user_'+ #userId")
    public LoginUserInfo getUserById(String userId) {
        System.out.println("如果没打印，则是从缓存中获取的值");
        LoginUserInfo info = new LoginUserInfo();
        info.setUserId(userId);
        info.setUserName("张三");
        return info;
    }
    
}
